package com.cicadasmall.system.wrapper;

import cn.hutool.core.lang.Assert;
import com.cicadasmall.common.func.Fn;
import com.cicadasmall.common.utils.SpringContextUtils;
import com.cicadasmall.common.utils.WarpsUtils;
import com.cicadasmall.common.wrapper.EntityWrapper;
import com.cicadasmall.data.domain.AttrDO;
import com.cicadasmall.system.service.IAttrService;
import com.cicadasmall.system.vo.AttrVO;

import java.util.List;

public class AttrWrapper implements EntityWrapper<AttrDO, AttrVO> {

    private final static IAttrService attrService;

    static {
        attrService = SpringContextUtils.getBean(IAttrService.class);
    }

    public static AttrWrapper newBuilder() {
        return new AttrWrapper();
    }

    @Override
    public AttrVO entityVO(AttrDO entity) {
        Assert.isTrue(Fn.isNotNull(entity), AttrDO.class.getName() + " 对象不存在！");
        return WarpsUtils.copyTo(entity, AttrVO.class);
    }


    @Override
    public List<AttrVO> treeVO(List<AttrDO> list) {
        return null;
    }
}